**BLEEK-LORBER "SECURITY GUARANTEES AND ALLIED PROLIFERATION" MASTER DO-FILE

log using SecGuar2013out, replace text

set mem 100m
set more off

use "C:\data\BleekDataVersion3.dta", clear

**"CORE" MULTIVARIATE MODEL

*Model 2, key indep var:

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

**"FULLY SPECIFIED" MULTIVARIATE MODEL

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

**AIC CALCULATIONS TO ADJUDICATE BETWEEN COX AND WEIBULL

**AIC Calculations for core model

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

estat ic

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

estat ic

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

estat ic

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, cluster(cowcc) robust nohr

estat ic

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, cluster(cowcc) robust nohr

estat ic

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, cluster(cowcc) robust nohr

estat ic

**AIC Calculations for fully specified model

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

estat ic

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

estat ic

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

estat ic

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, cluster(cowcc) robust nohr

estat ic

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, cluster(cowcc) robust nohr

estat ic

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, cluster(cowcc) robust nohr

estat ic

**HAZARD RATIOS TO ASSESS MAGNITUDE

*"Core" model, hazard ratios

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust

**ROBUSTNESS CHECKS

*Model 2a, key indep var, industry1 instead of new_econ (don't report detailed results)

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ industry1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ industry1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ industry1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 2b, key indep var, nucsecguarall instead of nucsecguarsup (don't report detailed results)

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarall new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarall new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarall new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 2c, key indep var, nucsecguarsup2 instead of nucsecguarsup, includes one-week 1945 defense pact (don't report detailed results)

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup2 new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup2 new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup2 new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 2d, key indep var, nucsecguarsup3 instead of nucsecguarsup, includes one-week 1945 defense pact and US-ROK alliance (don't report detailed results)

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup3 new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup3 new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup3 new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 3a, various more endogenous variables, nucsecguarall instead of nucsecguarsup

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarall new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarall new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarall new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 3b, various more endogenous variables, nucsecguarsup2 instead of nucsecguarsup

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup2 new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup2 new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup2 new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 3c, various more endogenous variables, nucsecguarsup2 instead of nucsecguarsup

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup3 new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup3 new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup3 new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr

*Model 3d, nucsecguarsupATOP instead

**CORE MULTIVARIATE MODEL

*Model 2, key indep var:

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsupATOP new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsupATOP new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsupATOP new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

**MULTIVARIATE MODEL W ALL JO AND GARTKZE VARIABLES EXCEPT DIFFUSION AND COUNT, DROPPING D_ISOL AND LN_XST1, ADDING nucass_full civass openness chopen5

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsupATOP democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsupATOP democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsupATOP democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

*Model 3e, Fuhrmann instead of Kroenig civil nuclear assistance variable

**MULTIVARIATE MODEL W ALL JO AND GARTKZE VARIABLES EXCEPT DIFFUSION AND COUNT, DROPPING D_ISOL AND LN_XST1, ADDING nucass_full civass openness chopen5

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full NCAtodate openness chopen5, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full NCAtodate openness chopen5, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full NCAtodate openness chopen5, d(weibull) cluster(cowcc) robust nohr


*Model 2x, Singh and Way instead of Bleek dependent variable coding

**CORE MULTIVARIATE MODEL

*Model 2, key indep var:

** explore
stset riskSW, id(cowcc) failure(link==1) exit(exitSW1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** pursue
stset riskSW, id(cowcc) failure(step==1) exit(exitSW2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** acquire
stset riskSW, id(cowcc) failure(explode==1) exit(exitSW3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr


**COX AS ROBUSTNESS CHECK

*Model 2 and Model 3, COX w/ Breslow method for handling ties as robustness check
*Model 2, key indep var:

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if cowcc<1000, cluster(cowcc) robust nohr

*Model 3, various more endogenous variables, COX instead of WEIBULL

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv  civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv nucass_full civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
stcox nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv civass npt_rati npt_eff majpow regpowt democ openness chopen5 if cowcc<1000, cluster(cowcc) robust nohr

**TRUNCATING MODELS TO BEGIN IN 1945, THE FIRST DATE ON WHICH SECURITY GUARANTEES WERE FEASIBLE

**CORE MULTIVARIATE MODEL

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if year>1944, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if year>1944, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if year>1944, d(weibull) cluster(cowcc) robust nohr

**DROPPING OBSERVATIONS BELOW PAKISTAN'S 1972 ECONOMIC DEVELOPMENT LEVEL (.0007292)

**CORE MULTIVARIATE MODEL

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if new_econ>.0007292 , d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if new_econ>.0007292 , d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv if new_econ>.0007292 , d(weibull) cluster(cowcc) robust nohr

**CENSORING BASED ON PRIOR EXPLORATION OR PURSUIT

gen exploreC=explore

gen exit1C=exit1

**"Core" model, censoring pursuit based on prior exploration, acquisition based on prior pursuit or exploration

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1 if exploreC~=0, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1 if pursue~=0, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1 if exploreC~=0, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv, d(weibull) cluster(cowcc) robust nohr

**"Fully specified" model, censoring pursuit based on prior exploration, acquisition based on prior pursuit or exploration

** pursue
stset risk1 if exploreC~=0, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1 if pursue~=0, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1 if exploreC~=0, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup new_econ nuk7set1 ln_ri_t nucriv democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

**DROPPING VARIABLES BY P-VALUE IN PURSUE IN FULLY SPECIFIED MODEL

**MODEL 3.0, MULTIVARIATE MODEL W ALL JO AND GARTKZE VARIABLES EXCEPT DIFFUSION AND COUNT, DROPPING D_ISOL AND LN_XST1, ADDING nucass_full civass openness chopen5

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati majpow regpowt nucass_full civass openness chopen5, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.1, MULTIVARIATE MODEL, DROP CHOPEN5

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full civass openness, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full civass openness, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow regpowt nucass_full civass openness, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.2, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow nucass_full civass openness, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow nucass_full civass openness, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow nucass_full civass openness, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.3, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup democ npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.4, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, DEMOC

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 new_econ ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.5, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass openness, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.6, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 ln_ri_t nucriv nucsecguarsup npt_rati npt_eff majpow civass, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.7, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati npt_eff majpow civass, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati npt_eff majpow civass, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati npt_eff majpow civass, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.8, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV, NPT_EFF

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati majpow civass, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati majpow civass, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati majpow civass, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.9, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV, NPT_EFF, CIVASS

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati majpow, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati majpow, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 ln_ri_t nucsecguarsup npt_rati majpow, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.10, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV, NPT_EFF, CIVASS, NPT_RATI

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 ln_ri_t nucsecguarsup majpow, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 ln_ri_t nucsecguarsup majpow, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 ln_ri_t nucsecguarsup majpow, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.11, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV, NPT_EFF, CIVASS, NPT_RATI, LN_RI_T

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 nucsecguarsup majpow, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 nucsecguarsup majpow, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 nucsecguarsup majpow, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.12, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV, NPT_EFF, CIVASS, NPT_RATI, LN_RI_T, MAJPOW

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nuk7set1 nucsecguarsup, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nuk7set1 nucsecguarsup, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nuk7set1 nucsecguarsup, d(weibull) cluster(cowcc) robust nohr

**MODEL 3.13, MULTIVARIATE MODEL, DROP CHOPEN5, REGPOWT, NUCASS_FULL, NEW_ECON, OPENNESS, NUCRIV, NPT_EFF, CIVASS, NPT_RATI, LN_RI_T, MAJPOW, NUK7SET1

** explore
stset risk1, id(cowcc) failure(explore==1) exit(exit1==1)
streg nucsecguarsup, d(weibull) cluster(cowcc) robust nohr

** pursue
stset risk1, id(cowcc) failure(pursue==1) exit(exit2==1)
streg nucsecguarsup, d(weibull) cluster(cowcc) robust nohr

** acquire
stset risk1, id(cowcc) failure(acquire==1) exit(exit3==1)
streg nucsecguarsup, d(weibull) cluster(cowcc) robust nohr

**REVISITING SINGH AND WAY 2004

*Singh and Way recreating and corrected allies variable
*Load ProlifQuantSW (obtained from Alex Montgomery, who obtained from Chris Way; different than data posted on JCR website)

*generate GDP-squared variable:
gen g2 = gdpcap^2

***recreate published Singh and Way findings:

**hazard models:
* explore
stset risk, id(cowcc) failure(link==1) exit(exit1==1)
streg gdpcap g2 industry1 rivalry disma allies polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr
* pursue
stset risk, id(cowcc) failure(step==1) exit(exit2==1)
streg gdpcap g2 industry1 rivalry disma allies polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) nohr robust
* acquire
stset risk, id(cowcc) failure(explode==1) exit(exit3==1)
streg gdpcap g2 industry2 rivalry disma allies polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) nohr cluster(cowcc)robust

** multinomial logit model:
mlogit level gdpcap g2 industry1 rivalry disma allies polity dch5 centdems openness chopen5 if cowcc<1000, robust

***correct Singh and Way, explicitly following their coding rules, run hazard and multinomial logit
*merge nucsecguarall2 nucsecguarall3 nucsecguarsup

merge cowcc year using C:\data\BleekDataVersion1.dta, sort keep(nucsecguarall2 nucsecguarall3 nucsecguarsup)

**hazard models:
* explore
stset risk, id(cowcc) failure(link==1) exit(exit1==1)
streg gdpcap g2 industry1 rivalry disma nucsecguarall2 polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr
* pursue
stset risk, id(cowcc) failure(step==1) exit(exit2==1)
streg gdpcap g2 industry1 rivalry disma nucsecguarall2 polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) nohr robust
* acquire
stset risk, id(cowcc) failure(explode==1) exit(exit3==1)
streg gdpcap g2 industry2 rivalry disma nucsecguarall2 polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) nohr cluster(cowcc)robust

** multinomial logit model:
mlogit level gdpcap g2 industry1 rivalry disma nucsecguarall2 polity dch5 centdems openness chopen5 if cowcc<1000, robust

***correct Singh and Way, integrating US-South Korea 1953 Mutual Defense Agreement

**hazard models:
* explore
stset risk, id(cowcc) failure(link==1) exit(exit1==1)
streg gdpcap g2 industry1 rivalry disma nucsecguarall3 polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr
* pursue
stset risk, id(cowcc) failure(step==1) exit(exit2==1)
streg gdpcap g2 industry1 rivalry disma nucsecguarall3 polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) nohr robust
* acquire
stset risk, id(cowcc) failure(explode==1) exit(exit3==1)
streg gdpcap g2 industry2 rivalry disma nucsecguarall3 polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) nohr cluster(cowcc)robust

** multinomial logit model:
mlogit level gdpcap g2 industry1 rivalry disma nucsecguarall3 polity dch5 centdems openness chopen5 if cowcc<1000, robust

**hazard models:
* explore
stset risk, id(cowcc) failure(link==1) exit(exit1==1)
streg gdpcap g2 industry1 rivalry disma nucsecguarsup polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) robust nohr
* pursue
stset risk, id(cowcc) failure(step==1) exit(exit2==1)
streg gdpcap g2 industry1 rivalry disma nucsecguarsup polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) cluster(cowcc) nohr robust
* acquire
stset risk, id(cowcc) failure(explode==1) exit(exit3==1)
streg gdpcap g2 industry2 rivalry disma nucsecguarsup polity dch5 centdems openness chopen5 if cowcc<1000, d(weibull) nohr cluster(cowcc)robust

** multinomial logit model:
mlogit level gdpcap g2 industry1 rivalry disma nucsecguarsup3 polity dch5 centdems openness chopen5 if cowcc<1000, robust

**REVISITING FUHRMANN 2009

*Load Fuhrmann_Spreading_Dataset.dta

merge cowcc year using C:\data\BleekDataVersion1.dta, sort keep(nucsecguarsup)

*Model 1
probit pursue1   NCAtodate disputes gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)
probit pursue1   NCAtodate disputes gdpcap g2 industry2 rivalry nucsecguarsup polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)

*Model 2
relogit pursue1   NCAtodate disputes gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)
relogit pursue1   NCAtodate disputes gdpcap g2 industry2 rivalry nucsecguarsup polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)

*Model 3
probit pursue1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)
probit pursue1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry nucsecguarsup polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)

*Model 4
relogit pursue1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)
relogit pursue1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry nucsecguarsup polity dch5 openness chopen5  npt pursueyrs, cluster(cowcc)

*Model 5
probit acquire1   NCAtodate disputes gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  acquireyrs, cluster(cowcc)
probit acquire1   NCAtodate disputes gdpcap g2 industry2 rivalry allies nucsecguarsup dch5 openness chopen5  acquireyrs, cluster(cowcc)

*Model 6
relogit acquire1   NCAtodate disputes gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  acquireyrs, cluster(cowcc)
relogit acquire1   NCAtodate disputes gdpcap g2 industry2 rivalry allies nucsecguarsup dch5 openness chopen5  acquireyrs, cluster(cowcc)

*Model 7
probit acquire1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  acquireyrs, cluster(cowcc)
probit acquire1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry nucsecguarsup polity dch5 openness chopen5  acquireyrs, cluster(cowcc)

*Model 8
relogit acquire1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry allies polity dch5 openness chopen5  acquireyrs, cluster(cowcc)
relogit acquire1   NCAtodate disputes NCAXMID gdpcap g2 industry2 rivalry nucsecguarsup polity dch5 openness chopen5  acquireyrs, cluster(cowcc)

**REVISITING JO AND GARTZKE 2007

*Load jo_gartzke_0207_replicate_0906.dta

merge cowcc year using C:\data\BleekDataVersion1.dta, sort keep(nucsecguarsup)

*Load jo_gartzke_0207_replicate_0906.dta

rename ccode1 cowcc
merge cowcc year using C:\data\BleekDataVersion1.dta, sort keep(nucsecguarsup)
rename cowcc ccode1

*creating time-dependence variables;
sort ccode1 year

gen count1=0

replace count1=count1[_n-1]+1 if ccode1==ccode1[_n-1] & nuk_apl==0

la var count1 "# years before ap=1"

sort ccode1 year

gen count2=0

replace count2=count2[_n-1]+1 if ccode1==ccode1[_n-1] & nuk_apl[_n-1]==1 & nuke_dfl==0

la var count2 "# years after ap=1 & before df=1"

sort ccode1 year

gen temp1=count1

replace temp1=temp1[_n-1]+1 if nuk_apl==1 & nuk_apl[_n-1]==0 & ccode1==ccode1[_n-1]

sort ccode1 year

gen temp2=count2

replace temp2=temp2[_n-1]+1 if nuke_dfl==1 & nuke_dfl[_n-1]==0 & ccode1==ccode1[_n-1]

replace temp2=0 if ccode==560 & year==1990

la var temp1 "# years before apl=1"

la var temp2 "# years after apl=1 & before dfl=1"

drop count1 count2

ren temp1 count1

ren temp2 count2

*creating trichotomy of nuclear threat;
generate n_threat =0

replace n_threat = 1 if r_nukep ==1

replace n_threat = 2 if r_nukeb ==1

*creating trichotomy of democracy;
generate tri_demo1 = democ

generate tri_demo2 = democ

replace tri_demo1 = 0

replace tri_demo1 = 1 if democ >=4 & democ <=7

replace tri_demo2 = 0

replace tri_demo2 = 1 if democ >=8

*Model 1(Nuclear Weapons Program);
probit nuk_apl nuk7set1 new_econ l_year_t ln_ri_t r_nukep nuke_a_d d_isol ln_xst1 democ npt_rati npt_eff majpow regpowt count1, robust cluster(ccode1)
probit nuk_apl nuk7set1 new_econ l_year_t ln_ri_t r_nukep nucsecguarsup d_isol ln_xst1 democ npt_rati npt_eff majpow regpowt count1, robust cluster(ccode1)

*Start of the analyses of nuke possession;
*Model 2-2(Non-Censored Model);
probit nuke_dfl nuk7set1 new_econ l_year_t ln_ri_t r_nukep nuke_a_d d_isol ln_xst1 democ npt_eff majpow regpowt count2, robust cluster(ccode1)
probit nuke_dfl nuk7set1 new_econ l_year_t ln_ri_t r_nukep nucsecguarsup d_isol ln_xst1 democ npt_eff majpow regpowt count2, robust cluster(ccode1)

*Model 2-1(Censored Model);
*Preparation for Model 2-1;
generate pn7set1 = nuk_apl*nuk7set1

generate pnew_econ = nuk_apl*new_econ

generate pl_year_t = nuk_apl*l_year_t

generate pln_ri_t = nuk_apl*ln_ri_t

generate pr_nukep = nuk_apl*r_nukep

generate pr_nukeb = nuk_apl*r_nukeb

generate pnuke_a_d = nuk_apl*nuke_a_d

generate pd_isol = nuk_apl*d_isol

generate pln_xst1 = nuk_apl*ln_xst1

generate pdemoc = nuk_apl*democ

generate pnpt_eff =nuk_apl*npt_eff

generate pmajpow = nuk_apl*majpow

generate pregpowt = nuk_apl*regpowt

generate nn_thre =0

replace  nn_thre = 1 if pr_nukep ==1

replace  nn_thre = 2 if pr_nukeb ==1

*analysis for Model 2-1
*dropping all cases with no nuclear weapons program;
replace nuke_dfl = . if nuk_apl ==0

probit nuke_dfl pn7set1 pnew_econ pl_year_t pln_ri_t pr_nukep pnuke_a_d pd_isol pln_xst1 pdemoc pnpt_eff pmajpow pregpowt count2, robust cluster(ccode1)
probit nuke_dfl pn7set1 pnew_econ pl_year_t pln_ri_t pr_nukep nucsecguarsup pd_isol pln_xst1 pdemoc pnpt_eff pmajpow pregpowt count2, robust cluster(ccode1)